// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.modules.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.liuxinlong.modules.dao.RoleDao;
import com.liuxinlong.modules.entity.UserRole;
import com.liuxinlong.modules.mapper.RoleMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

/**
 * 类描述
 * <p>
 * 此类关联设计的功能
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2022年2月22日
 */
@Service
public class RoleDaoImpl extends ServiceImpl<RoleMapper, UserRole> implements RoleDao {

	@Override
	public List<UserRole> pageRoleList(Map<String, Object> queryParam) {
		return baseMapper.pageRoleList(queryParam);
	}

	@Override
	public int getRoleCount(Map<String, Object> queryParam) {

		return baseMapper.getRoleCount(queryParam);
	}

	@Override
	public void addRole(UserRole role) {
		baseMapper.insert(role);
	}

	@Override
	public void updateRole(UserRole role) {
		baseMapper.updateById(role);
	}

	@Override
	public void deleteRole(String roleId) {
		baseMapper.deleteById(roleId);
	}

	@Override
	public Map<String, Map<String, String>> getRoleMap() {
		return baseMapper.getRoleMap();
	}

	@Override
	public List<UserRole> getRoleList() {
		return baseMapper.getRoleList();
	}

	@Override
	public Map<String, Map<String, String>> getRoleMapByName() {
		return baseMapper.getRoleMapByName();
	}

	@Override
	public UserRole getRoleBySn(String sn) {
		return baseMapper.getRoleBySn(sn);
	}

}
